/*
 * clog_category.h
 *
 *  Created on: 2012-8-12
 *      Author: lin
 */

#ifndef CLOG_CATEGORY_H_
#define CLOG_CATEGORY_H_

#include "def/defs.h"
#include "zmalloc/zmalloc.h"

typedef struct clog_category {
    uint32_t id;
    uint16_t name_len;
    char name[0];
} clog_category_t;

clog_category_t * clog_category_new(const char* name);
static inline void clog_category_free(clog_category_t *category) {
    zfree(category);
}
#define clog_category_get_name(category) (category)->name
#define clog_category_get_id(category) (category)->id
#endif /* CLOG_CATEGORY_H_ */
